@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --paper: #f3f0e8;
  --paper-2: #ebe7dc;
  --ink: #171716;
  --muted: #66635d;
  --line: #d4cfc3;
  --blue: #275dff;
  --blue-dark: #1544d9;
  --skills: #dce4ed;
  --night: #111214;
  --white: #fff;
  --max: 1240px;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --radius: 1.15rem;
  --shadow: 0 24px 70px rgba(23, 23, 22, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.65 'DM Sans', sans-serif; overflow-x: hidden; }
body.dialog-open { overflow: hidden; }
img, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
button, input, textarea { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid #ffb800; outline-offset: 4px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 999; background: var(--white); color: var(--ink); padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }
.container { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.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; }
.section { padding: clamp(4.5rem, 9vw, 8rem) 0; }
.eyebrow { margin: 0 0 1.25rem; font-size: .74rem; line-height: 1; letter-spacing: .19em; text-transform: uppercase; font-weight: 700; }
.display { margin: 0; font-family: 'Bebas Neue', sans-serif; font-size: clamp(4rem, 11vw, 9.6rem); line-height: .86; letter-spacing: -.015em; font-weight: 400; }
:lang(en) .display { font-size: clamp(3.8rem, 8.3vw, 8rem); }
.section-title { margin: 0; font-size: clamp(2.35rem, 5vw, 5rem); line-height: .96; letter-spacing: -.05em; }
.lede { max-width: 760px; font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.48; }
.muted { color: var(--muted); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .55rem; min-height: 3.25rem; padding: .8rem 1.3rem; border: 1px solid var(--ink); background: var(--ink); color: var(--white); font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; transition: transform .2s ease, background .2s ease, color .2s ease; }
.button:hover { transform: translateY(-2px); background: var(--blue); border-color: var(--blue); }
.button--outline { background: transparent; color: var(--ink); }
.button--outline:hover { color: var(--white); }
.button--light { background: var(--white); color: var(--ink); border-color: var(--white); }
.button--ghost { background: transparent; border-color: rgba(255,255,255,.45); }
.button--hero { min-height: 4.5rem; padding: 1rem 1.6rem; font-size: 1rem; }
.text-link { font-weight: 700; }

.site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(23,23,22,.13); background: rgba(243,240,232,.9); backdrop-filter: blur(14px); }
.nav { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { flex: 0 0 auto; font-family: 'Bebas Neue', sans-serif; font-size: 1.45rem; letter-spacing: .09em; text-decoration: none; line-height: 1; }
.nav-links { display: flex; align-items: center; justify-content: flex-end; gap: clamp(.8rem, 2vw, 2rem); }
.nav-links a { font-size: .78rem; font-weight: 700; text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current='page'] { color: var(--blue); }
.lang { border-left: 1px solid var(--line); padding-left: 1rem; }
.menu-toggle { display: none; padding: .65rem; border: 0; background: transparent; }
.menu-toggle span { display: block; width: 1.55rem; height: 2px; background: currentColor; margin: 5px 0; }

.hero-copy { padding: clamp(4rem, 7vw, 7rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: clamp(2rem, 7vw, 7rem); align-items: center; }
.hero-grid > * { min-width: 0; }
.hero-sub { margin: 2.4rem 0 .35rem; max-width: 820px; font-size: clamp(1.25rem, 2.3vw, 1.75rem); line-height: 1.3; font-weight: 600; }
.hero-context { margin: 0; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; margin-top: 2rem; }
.hero-actions .button { width: 100%; min-height: 4.5rem; padding: 1rem 1.6rem; font-size: 1rem; }
.hero-secondary { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.4rem; }
.hero-secondary a { font-size: .85rem; font-weight: 700; }
.hero-image { width: 100%; aspect-ratio: 16/8.35; object-fit: cover; object-position: center 48%; }

.trust { background: var(--night); color: var(--white); }
.trust-inner { min-height: 10rem; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; gap: clamp(1rem, 5vw, 5rem); padding-block: 2.2rem; }
.trust img { margin: auto; width: auto; max-width: 180px; max-height: 68px; object-fit: contain; filter: grayscale(1); opacity: .82; }
.trust img.velon { max-height: 82px; filter: grayscale(1); }

.projects-head { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.project-feature { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 4rem); align-items: center; margin-bottom: 4rem; }
.project-feature picture, .project-card-media, .case-hero-media { background: #ddd8cd; }
.project-feature img { display: block; width: 100%; height: auto; }
.project-title { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; }
.project-logo { flex: 0 0 auto; display: block; width: auto; height: 1.75rem; max-width: 9rem; object-fit: contain; object-position: left center; }
.project-logo--momparler { filter: invert(1); }
.project-name { margin: 0; font-size: clamp(2rem, 4vw, 4.2rem); line-height: .98; letter-spacing: -.045em; }
.project-copy p { color: var(--muted); }
.proof { display: flex; flex-wrap: wrap; gap: .7rem 1.4rem; margin: 1.5rem 0; padding: 1.1rem 0; border-block: 1px solid var(--line); }
.proof strong { display: block; font-size: 1.1rem; color: var(--ink); }
.proof span { color: var(--muted); font-size: .78rem; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 4rem); }
.project-card { min-width: 0; }
.project-card-media { display: block; }
.project-card-media.single { display: block; }
.project-card-media img { display: block; width: 100%; height: auto; }
.project-card-body { padding-top: 1.5rem; }
.project-card .project-name { font-size: clamp(2rem, 3vw, 3.25rem); }
.project-card p { color: var(--muted); }
.projects-archive { margin-top: clamp(2rem, 4vw, 3.5rem); }

@media (min-width: 901px) {
  .project-feature .project-title { display: block; }
  .project-feature .project-logo--calendar { height: 1.5rem; margin-bottom: .7rem; }
}

.skills { background: var(--skills); }
.skills-intro { max-width: 900px; margin-bottom: 4rem; }
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(23,23,22,.2); }
.skill { background: var(--skills); padding: clamp(1.5rem, 3vw, 2.8rem); }
.skill-icon { width: 1.25rem; height: 1.25rem; margin-bottom: .9rem; color: var(--blue); }
.skill-icon svg { display: block; width: 100%; height: 100%; }
.skill h3 { margin: 0 0 1rem; font-size: 1.35rem; line-height: 1.2; }
.ai-note { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.5rem; align-items: start; margin: 3rem 0 0; padding-left: 1.2rem; border-left: 1px solid rgba(23,23,22,.3); }
.ai-note-label { padding-top: .25rem; color: var(--blue-dark); font-size: .7rem; line-height: 1.3; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ai-note p { max-width: 790px; margin: 0; }

.profile { position: relative; background: var(--night); color: var(--white); overflow: hidden; }
.profile::after { content: ''; position: absolute; inset: 0 0 0 54%; background: url('/images/hero.jpg') left center/auto 100% no-repeat; opacity: .1; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%); mask-image: linear-gradient(90deg, transparent 0, #000 30%); }
.profile-inner { position: relative; z-index: 1; max-width: 750px; }
.profile .section-title { max-width: 660px; }
.profile-text { margin: 2rem 0; color: #cbc9c4; font-size: 1.08rem; }
.profile .button { margin-top: 1.25rem; }
.timeline { margin: 4rem 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(255,255,255,.2); }
.timeline li { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.timeline time { color: #9c9c9c; font-size: .82rem; }

.now-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.now-card { padding: 1.75rem; border: 1px solid var(--line); background: rgba(255,255,255,.26); }
.now-card--link { display: block; text-decoration: none; transition: border-color .2s, transform .2s, background .2s; }
.now-card--link:hover { border-color: var(--blue); background: rgba(255,255,255,.48); transform: translateY(-2px); }
.now-card h3 { margin-top: 0; font-size: 1.4rem; }
.now-logo { display: flex; align-items: center; height: 58px; margin-bottom: 1.2rem; }
.now-logo img { width: auto; max-width: 170px; max-height: 54px; object-fit: contain; object-position: left center; }
.now-logo--giro img { max-width: 112px; content: url('/images/redesign/giro-ditalia-logo.svg'); }
.now-logo--velon img { max-width: 150px; }
.now-logo--calendar { gap: .6rem; color: var(--blue); }
.now-logo--calendar svg { flex: 0 0 auto; width: 30px; height: 30px; }

.testimonials { background: var(--skills); }
.testimonials .section-title { margin-bottom: 1.8rem; }
.testimonial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.testimonial-card { display: grid; grid-template-columns: 96px 1fr; gap: 1.35rem; align-items: start; width: 100%; min-height: 218px; text-align: left; padding: 1.4rem; border: 1px solid var(--line); background: rgba(255,255,255,.28); cursor: pointer; transition: border-color .2s, transform .2s; }
.testimonial-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.testimonial-card img { width: 96px; height: 112px; object-fit: cover; object-position: center; }
.testimonial-quote { margin: 0 0 1rem; font-size: 1.08rem; line-height: 1.4; }
.testimonial-name { display: block; font-weight: 700; }
.testimonial-role { display: block; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.testimonial-more { display: inline-block; margin-top: .8rem; color: var(--blue); font-size: .78rem; font-weight: 700; }

@media (min-width: 681px) {
  .testimonial-card { min-height: 172px; padding: 1.25rem 1.4rem; }
  .testimonial-card > span { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; align-content: start; }
  .testimonial-quote, .testimonial-name, .testimonial-role { grid-column: 1 / -1; }
  .testimonial-more { grid-column: 2; justify-self: end; margin-top: .55rem; white-space: nowrap; }
}

.more-work { background: var(--paper-2); }
.more-work-inner { display: flex; justify-content: space-between; gap: 3rem; align-items: center; }
.more-work p { max-width: 650px; }
.contact { background: var(--blue); color: var(--white); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 7vw, 7rem); align-items: start; }
.contact .section-title { max-width: 570px; }
.contact p { color: #e9edff; }
.contact-form { display: grid; gap: 1rem; }
.field label { display: block; margin-bottom: .35rem; font-size: .78rem; font-weight: 700; }
.field input, .field textarea { width: 100%; border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.1); color: var(--white); padding: .9rem; border-radius: 0; }
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,.68); }
.field textarea { min-height: 135px; resize: vertical; }
.form-status { min-height: 1.5rem; margin: 0; }

.footer { background: var(--night); color: #b7b7b4; padding: 2.5rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer a { color: var(--white); }

.page-hero { padding: clamp(5rem, 10vw, 9rem) 0 clamp(3rem, 6vw, 5rem); }
.page-hero .section-title { max-width: 980px; }
.page-hero .lede { margin-top: 2rem; }
.archive-hero { padding-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.archive-hero .lede { margin-top: 1.1rem; }
.case-list { display: grid; gap: 6rem; }
.case-row { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.case-row:nth-child(even) .case-row-media { order: 2; }
.case-row-media img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.case-row-media.duo { display: grid; grid-template-columns: 1fr 1fr; }
.case-row-media.duo img { height: 100%; }
.archive-teaser { margin-top: 7rem; padding: clamp(2rem, 5vw, 4rem); background: var(--night); color: var(--white); }
.archive-teaser .muted { color: #bdbdb8; }

.case-hero { padding: clamp(4rem, 8vw, 7rem) 0; }
.case-hero-grid { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: clamp(2.5rem, 6vw, 6rem); }
.case-hero h1 { margin: 0; font-size: clamp(3rem, 6vw, 6.6rem); line-height: .92; letter-spacing: -.055em; }
.case-hero-media img { display: block; width: 100%; height: auto; }
.case-section { border-top: 1px solid var(--line); padding: clamp(3.5rem, 7vw, 6rem) 0; }
.case-layout { display: grid; grid-template-columns: .55fr 1.45fr; gap: clamp(2rem, 7vw, 8rem); }
.case-layout h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.05; }
.case-content { max-width: 800px; }
.case-content > :first-child { margin-top: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); margin: 2.5rem 0; }
.metric { background: var(--paper); padding: 1.5rem; }
.metric strong { display: block; font-size: clamp(1.6rem, 3vw, 2.7rem); line-height: 1; }
.metric span { color: var(--muted); font-size: .78rem; }
.feature-columns { columns: 2; column-gap: 3rem; padding-left: 1.2rem; }
.feature-columns li { break-inside: avoid; margin-bottom: .5rem; }
.case-quote { margin: 2.5rem 0; padding: 2rem; border-left: 5px solid var(--blue); background: var(--paper-2); font-size: 1.25rem; }
.case-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.case-actions--split { display: grid; gap: .8rem; }
.case-actions__main, .case-actions__apps { display: flex; flex-wrap: wrap; gap: .8rem; }
.case-actions__apps .button { min-height: 2.5rem; padding: .55rem .85rem; font-size: .68rem; }
.technical summary { cursor: pointer; font-weight: 700; }

.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.5rem; }
.filter { border: 1px solid var(--ink); background: transparent; padding: .65rem 1rem; cursor: pointer; font-size: .78rem; font-weight: 700; }
.filter[aria-pressed='true'], .filter:hover { background: var(--ink); color: var(--white); }
.archive-grid { columns: 3; column-gap: 1.5rem; }
.work-card { min-width: 0; break-inside: avoid; margin-bottom: 1.5rem; border: 1px solid var(--line); background: rgba(255,255,255,.25); }
.work-card[hidden] { display: none; }
.work-card[data-category~='editorial'] { display: none; }
.work-media { position: relative; display: block; width: 100%; border: 0; padding: 0; background: #d9d6ce; cursor: pointer; overflow: hidden; }
.work-media img { width: 100%; height: auto; object-fit: contain; transition: transform .35s ease; }
.work-media:hover img { transform: scale(1.025); }
.play-mark { position: absolute; inset: auto auto 1rem 1rem; display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--white); }
.work-body { padding: 1.2rem; }
.work-meta { color: var(--ink); font-size: .7rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
.work-meta strong { font-weight: 700; }
.work-meta .work-type { color: var(--blue); }
.work-body h2 { margin: .45rem 0; font-size: 1.2rem; line-height: 1.25; }
.work-body p { margin: 0; color: var(--muted); font-size: .9rem; }

.dialog { width: min(880px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.dialog-close { position: sticky; z-index: 2; top: 1rem; float: right; margin: 1rem; width: 2.8rem; height: 2.8rem; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; }
.dialog-inner { padding: clamp(1.5rem, 5vw, 4rem); overflow: auto; }
.dialog-person { display: grid; grid-template-columns: 104px 1fr; gap: 1.5rem; align-items: center; margin-bottom: 2rem; }
.dialog-person img { width: 104px; height: 120px; object-fit: cover; }
.dialog h2 { margin: 0; font-size: 1.8rem; }
.dialog-role { color: var(--muted); }
.dialog-text { font-size: 1.08rem; }
.media-dialog { background: #090909; color: var(--white); width: min(1100px, calc(100% - 2rem)); }
.media-dialog .dialog-close { color: var(--white); border-color: var(--white); background: #090909; }
.media-stage { clear: both; padding: 0 1rem 1rem; }
.media-stage img, .media-stage video { max-height: calc(100vh - 7rem); margin: auto; object-fit: contain; }
.media-stage iframe { display: block; width: 100%; height: min(82vh, 1000px); border: 0; background: var(--white); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .65s ease, transform .65s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav-links { position: fixed; inset: 5rem 0 auto; display: none; align-items: stretch; justify-content: start; justify-items: start; padding: 1.2rem var(--gutter) 1.7rem; background: var(--paper); border-bottom: 1px solid var(--line); }
  .nav-links.is-open { display: grid; }
  .nav-links a { padding: .45rem 0; font-size: .95rem; }
  .lang { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: .75rem !important; }
  .hero-grid, .skills-intro, .contact-grid, .case-hero-grid { grid-template-columns: 1fr; }
  .hero-grid { align-items: start; }
  .hero-actions { margin-top: 1.15rem; }
  .project-feature, .case-row, .case-layout { grid-template-columns: 1fr; }
  .project-feature { gap: 1.5rem; }
  .project-feature .project-copy { padding-top: 0; }
  .project-feature .project-logo--calendar { width: auto; height: 1.75rem; margin: 0; object-position: left center; }
  .case-row:nth-child(even) .case-row-media { order: 0; }
  .profile::after { inset: 35% -15% 0 25%; }
  .archive-grid { columns: 2; }
}

@media (max-width: 800px) {
  .trust-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
  .trust img { max-width: 130px; max-height: 54px; }
}

@media (max-width: 680px) {
  .section { padding-block: 4.25rem; }
  .display { font-size: clamp(3.5rem, 19vw, 6.4rem); }
  :lang(en) .display { font-size: clamp(3rem, 16.7vw, 5.8rem); }
  .hero-copy { padding-top: 3.25rem; }
  .hero-secondary { margin-top: .8rem; }
  .hero-image { aspect-ratio: 4/3; object-position: 50% 50%; }
  .trust-inner { min-height: 13rem; gap: 2.2rem; }
  .trust img { max-width: 120px; max-height: 48px; }
  .project-grid, .skill-grid, .now-grid, .testimonial-grid { grid-template-columns: 1fr; }
  .archive-grid { columns: 1; }
  .project-feature { margin-bottom: 3rem; }
  .testimonial-card { grid-template-columns: 74px 1fr; min-height: 0; padding: 1rem; gap: 1rem; }
  .testimonial-card img { width: 74px; height: 88px; }
  .testimonial-quote { font-size: .98rem; }
  .more-work-inner, .footer-inner { align-items: flex-start; flex-direction: column; }
  .timeline li { grid-template-columns: 1fr; gap: .2rem; }
  .metric-grid { grid-template-columns: 1fr; }
  .feature-columns { columns: 1; }
  .ai-note { grid-template-columns: 1fr; gap: .65rem; }
  .dialog-person { grid-template-columns: 78px 1fr; }
  .dialog-person img { width: 78px; height: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
