/* Epoca – foglio di stile della bozza */

:root {
  --ink: #141414;
  --paper: #F3F1EC;
  --graphite: #55534E;
  --red: #A3322A;
  --stone: #E7E4DD;
  --frame: #2B2A27;
  --on-ink-muted: #A9A59C;
  --on-ink-soft: #CFCBC2;
  --line-ink: #3A3935;
  --line-paper: #D3CFC6;

  --font: "Schibsted Grotesk", Inter, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 72px);
  --header-h: 64px;

  --text: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --small: 0.9375rem;
  --lead: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  --h3: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem);
  --h2: clamp(2.5rem, 1.6rem + 4vw, 4.75rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 8px); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text);
  line-height: 1.55;
  background: var(--ink);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 14px; background: var(--paper); color: var(--ink); font-weight: 700;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Logo: la parola e il segno ---------- */

.logo {
  position: relative;
  display: inline-block;
  padding-bottom: 0.3em;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.8;
  text-decoration: none;
  color: inherit;
}
.logo svg {
  position: absolute; left: 0; bottom: 0;
  width: 145%; height: 0.17em;
}
.logo--nav { font-size: 1.5rem; }
.logo--footer { font-size: 1.25rem; }

.segno path { fill: var(--red); }

/* ---------- Testata e menu ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink); color: var(--paper);
  border-bottom: 1px solid var(--line-ink);
}
.site-header__bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px;
  min-height: var(--header-h);
}

.nav ul { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.nav a {
  color: var(--on-ink-soft); text-decoration: none;
  font-size: var(--small); font-weight: 500;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--paper); }

.menu-toggle {
  display: none;
  min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line-ink); background: transparent; color: var(--paper);
  font: inherit; font-size: var(--small); font-weight: 600; cursor: pointer;
}

@media (max-width: 880px) {
  .js .menu-toggle { display: inline-flex; align-items: center; }
  .js .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--ink); border-bottom: 1px solid var(--line-ink);
  }
  .js .nav.is-open { display: block; }
  .nav ul { flex-wrap: wrap; gap: 4px 20px; }
  .js .nav ul { flex-direction: column; gap: 0; padding: 4px var(--gutter) 20px; }
  .js .nav a {
    display: block; padding: 14px 0;
    border-top: 1px solid var(--line-ink);
    font-size: 1.25rem; color: var(--paper);
  }
}

/* ---------- Bottoni e link ---------- */

.button {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 12px 22px;
  border: 1px solid currentColor; background: transparent; color: inherit;
  font: inherit; font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.section--paper .button:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.text-link { font-weight: 700; text-decoration-thickness: 1px; }
.text-link:hover { text-decoration-thickness: 2px; }

/* ---------- Apertura ---------- */

.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-block: clamp(56px, 9vh, 112px) clamp(40px, 7vh, 80px);
  background: var(--ink); color: var(--paper);
}
.hero__title {
  margin: 0;
  font-size: clamp(5.25rem, 22vw, 19.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.78;
}
/* parola e segno al centro dello spazio libero, payoff in basso */
.hero__top { margin-top: auto; }
/* il segno parte sotto la parola e prosegue fino al bordo dello schermo */
.hero__segno {
  height: clamp(14px, 2.3vw, 32px);
  margin-top: clamp(16px, 2.2vw, 30px);
  margin-bottom: auto;
  margin-left: max(var(--gutter), calc((100% - var(--maxw)) / 2));
}
.hero__segno svg { display: block; width: 100%; height: 100%; }

.hero__foot {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 28px 48px;
  margin-top: clamp(40px, 7vh, 88px);
}
.hero__payoff {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.375rem);
  font-weight: 700; letter-spacing: -0.015em; line-height: 1.15;
}
.hero__desc { margin-top: 10px; color: var(--on-ink-muted); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero__segno svg {
    clip-path: inset(0 100% 0 0);
    animation: segno 1.6s cubic-bezier(0.22, 0.7, 0.18, 1) 0.35s forwards;
  }
  @keyframes segno { to { clip-path: inset(0 0 0 0); } }
}

/* ---------- Sezioni ---------- */

.section { display: flow-root; padding-block: clamp(72px, 10vw, 152px); overflow-x: clip; }
.page-head, .work-hero { display: flow-root; }
.section--flush-top { padding-top: 0; }
.section--ink { background: var(--ink); color: var(--paper); }
.section--paper { background: var(--paper); color: var(--ink); }
.section--stone { background: var(--stone); color: var(--ink); }

.section--ink .muted { color: var(--on-ink-muted); }
.section--paper .muted,
.section--stone .muted { color: var(--graphite); }

.h2 {
  margin: 0;
  font-size: var(--h2); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1;
}
.lead { margin-top: 1.25rem; max-width: 40ch; font-size: var(--lead); line-height: 1.4; }
.h2, .page-title, .contact__title, .hero__payoff, .film-title, .work__title { text-wrap: balance; }

/* titolo con il segno sotto */
.segnato { position: relative; display: inline-block; padding-bottom: 0.32em; }
.segnato svg { position: absolute; left: 0; bottom: 0; width: 112%; height: 0.2em; }

/* ---------- Manifesto ---------- */

.manifesto__grid { display: grid; gap: 40px; }
.manifesto__text p { max-width: 38em; margin-bottom: 1.1em; }
.manifesto__text p:last-child { margin-bottom: 0; font-weight: 700; }
@media (min-width: 900px) {
  .manifesto__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; }
  .manifesto__grid .h2 { grid-column: 1 / -1; }
  .manifesto__text { grid-column: 5 / span 8; }
}

/* ---------- Film in evidenza ---------- */

.film__client { margin-bottom: 10px; color: var(--on-ink-muted); }
.film__head { margin-bottom: clamp(24px, 3vw, 40px); }

.video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--frame); }
.video img { width: 100%; height: 100%; object-fit: cover; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  width: 100%; border: 0; cursor: pointer;
  background: rgba(20, 20, 20, 0.35); color: var(--paper);
  font: inherit; font-size: 1.125rem; font-weight: 700; text-decoration: none;
}
.video__play:hover { background: rgba(20, 20, 20, 0.15); }
.video__icon {
  display: grid; place-items: center;
  width: 72px; height: 72px; border: 2px solid currentColor; border-radius: 50%;
}
.video__icon svg { width: 22px; height: 22px; margin-left: 4px; fill: currentColor; }

.film__foot {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 16px 40px; margin-top: 24px;
}
.film__foot p { max-width: 60ch; }

/* ---------- Chi siamo ---------- */

.founders { display: grid; gap: 64px; margin-top: clamp(48px, 6vw, 88px); }
@media (min-width: 860px) {
  .founders { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(40px, 5vw, 88px); }
}
.founder__photo {
  width: 100%; max-width: 400px; aspect-ratio: 4 / 5;
  object-fit: cover; object-position: 50% 25%;
  filter: grayscale(1) contrast(1.06);
  background: var(--stone);
}
.founder__name {
  margin: 28px 0 4px;
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.05;
}
.founder__role { margin-bottom: 16px; color: var(--graphite); font-weight: 600; }
.founder__bio { max-width: 36em; }
.credits__title { margin: 28px 0 8px; font-size: var(--small); font-weight: 700; }
.credits { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-paper); }
.credits li { padding: 10px 0; border-bottom: 1px solid var(--line-paper); font-size: var(--small); }
cite { font-style: italic; }

/* ---------- Documentari d'impresa ---------- */

.formats { display: grid; gap: 56px; margin-top: clamp(40px, 5vw, 72px); }
@media (min-width: 900px) {
  .formats { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
}
.frame { aspect-ratio: 2.39 / 1; overflow: hidden; background: var(--frame); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.format__name {
  margin: 20px 0 2px;
  font-size: var(--h3); font-weight: 800; letter-spacing: -0.015em; line-height: 1.15;
}
.format__length { margin-bottom: 10px; color: var(--on-ink-muted); font-variant-numeric: tabular-nums; }

/* ---------- Eventi ---------- */

.eventi__grid { display: grid; gap: 48px; margin-top: clamp(40px, 5vw, 72px); }
@media (min-width: 960px) {
  .eventi__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(40px, 5vw, 88px); align-items: start; }
}
.services { margin: 0; border-top: 1px solid var(--line-paper); }
.service { display: grid; gap: 4px 32px; padding: 20px 0; border-bottom: 1px solid var(--line-paper); }
@media (min-width: 700px) {
  .service { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); }
}
.service dt { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.service dd { margin: 0; color: var(--graphite); }
.eventi__photo { aspect-ratio: 4 / 5; overflow: hidden; background: var(--frame); }
.eventi__photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Perché Epoca ---------- */

.reasons { display: grid; gap: 40px 56px; margin-top: clamp(40px, 5vw, 72px); }
@media (min-width: 800px) {
  .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.reason { padding-top: 20px; border-top: 1px solid var(--line-ink); }
.reason h3 { margin: 0 0 8px; font-size: var(--h3); font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; }
.reason p { max-width: 34em; color: var(--on-ink-soft); }

/* ---------- Filmografia (anteprima lavori) ---------- */

.filmography { margin: clamp(40px, 5vw, 64px) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-paper); }
.filmography li { border-bottom: 1px solid var(--line-paper); }
.filmography a {
  display: grid; grid-template-columns: 6rem minmax(0, 1fr);
  gap: 4px 24px; align-items: baseline;
  padding: 20px 0; color: inherit; text-decoration: none;
}
.film-year { color: var(--graphite); font-variant-numeric: tabular-nums; }
.film-title {
  font-size: clamp(1.375rem, 1.1rem + 1.1vw, 2rem); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.1;
}
.film-meta { grid-column: 2; color: var(--graphite); }
.filmography a:hover .film-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
@media (min-width: 800px) {
  .filmography a { grid-template-columns: 7rem minmax(0, 1.25fr) minmax(0, 1fr); }
  .film-meta { grid-column: auto; }
}
.lavori__more { margin-top: 32px; }

/* ---------- Contatti e piè di pagina ---------- */

.contact__title { margin: 0; font-size: clamp(3rem, 1.8rem + 6vw, 7.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; }
.contact__intro { margin-top: 28px; max-width: 46ch; font-size: var(--lead); line-height: 1.4; color: var(--on-ink-soft); }
.contact__lines { display: grid; gap: 28px; margin: clamp(40px, 5vw, 64px) 0 0; }
@media (min-width: 800px) {
  .contact__lines { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.contact__lines dt { color: var(--on-ink-muted); font-size: var(--small); }
.contact__lines dd { margin: 4px 0 0; font-size: 1.375rem; font-weight: 700; }

.site-footer { padding-block: 32px 40px; background: var(--ink); color: var(--on-ink-muted); border-top: 1px solid var(--line-ink); font-size: var(--small); }
.site-footer__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; }
.site-footer .logo { color: var(--paper); }
.site-footer__text { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-footer a { color: var(--on-ink-soft); }

/* ---------- Pagina Lavori ---------- */

.page-head { padding-block: clamp(56px, 8vw, 120px) clamp(32px, 4vw, 56px); }
.page-title { margin: 0; font-size: clamp(3rem, 2rem + 5vw, 6.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.filter {
  min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--line-paper); background: transparent; color: var(--ink);
  font: inherit; font-size: var(--small); font-weight: 600; cursor: pointer;
}
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.works-count { margin-top: 16px; color: var(--graphite); font-size: var(--small); }

.works { display: grid; gap: 56px 32px; margin: 40px 0 0; padding: 0; list-style: none; }
@media (min-width: 800px) {
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.work a { display: block; color: inherit; text-decoration: none; }
.work__title { margin: 18px 0 4px; font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.work__meta { color: var(--graphite); }
.work a:hover .work__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }

/* ---------- Scheda del singolo lavoro ---------- */

.work-hero { padding-block: clamp(40px, 6vw, 88px) clamp(56px, 7vw, 104px); }
.back-link { display: inline-block; margin-bottom: clamp(32px, 4vw, 56px); color: var(--on-ink-soft); font-size: var(--small); }
.work-hero__meta { margin-top: 16px; color: var(--on-ink-muted); }
.work-hero__media { margin-top: clamp(32px, 4vw, 56px); }

.work-body { display: grid; gap: 40px; }
@media (min-width: 900px) {
  .work-body { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; }
  .work-body__credits { grid-column: 1 / span 4; }
  .work-body__text { grid-column: 6 / span 7; }
}
.work-credits { margin: 0; border-top: 1px solid var(--line-paper); }
.work-credits div { padding: 14px 0; border-bottom: 1px solid var(--line-paper); }
.work-credits dt { color: var(--graphite); font-size: var(--small); }
.work-credits dd { margin: 2px 0 0; font-weight: 700; }
.work-body__text p { max-width: 38em; margin-bottom: 1.1em; font-size: var(--lead); line-height: 1.45; }

.pager {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px;
  margin-top: clamp(56px, 7vw, 96px); padding-top: 24px; border-top: 1px solid var(--line-paper);
}
.pager a { display: block; max-width: 22rem; color: inherit; text-decoration: none; }
.pager span { display: block; color: var(--graphite); font-size: var(--small); }
.pager strong { display: block; font-size: 1.25rem; letter-spacing: -0.01em; }
.pager a:hover strong { text-decoration: underline; }
.pager__next { margin-left: auto; text-align: right; }

/* ---------- Pagine semplici (privacy, 404) ---------- */

.plain { max-width: 46em; }
.plain h2 { margin: 40px 0 8px; font-size: var(--h3); }
.plain p { margin-bottom: 1em; }

.notfound { min-height: calc(100svh - var(--header-h)); display: flex; flex-direction: column; justify-content: center; gap: 24px; }
